<?php
/**
 * Created by PhpStorm.
 * User: mars
 * Date: 2019/1/27
 * Time: 12:35 PM
 */

namespace api\models;


use common\models\Options;
use Yii;

class Banner extends Options
{
    public function fields()
    {
        return [
            'img' => function ($model) {
                $cdn       = Yii::$app->get('cdn');
                $cdn->host = Yii::$app->feehi->website_url;

                return $cdn->getCdnUrl($model->image);
            },
            'link',
            'sort',
        ];
    }
}